/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ServerImpl.java
 *
 * Created on 24-Mar-2009, 13:47:12
 */

package instantmessenger;



public class ServerImpl extends javax.swing.JFrame {

    /** Creates new form ServerImpl */
    public ServerImpl() {
        initComponents();
    }
/*
    public void startServer() {

        try {

            String defpath = System.getProperty("user.dir");


            //Create and install a security manager
            if (System.getSecurityManager() == null)
                System.setSecurityManager(new RMISecurityManager());
            ChatServerImpl chatServerImpl = new ChatServerImpl();
            // run a local mini-web server
            fileServer = new ClassFileServer(1999,defpath+"\\build\\classes");
            // Bind this object instance to the name "ChatServer"

            try {
                java.rmi.registry.LocateRegistry.createRegistry(1099);
                System.out.println("Starting registry");
            } catch (RemoteException ex) {
                System.out.println("Error starting registry");
            }


            Naming.rebind("//localhost/ChatServer", chatServerImpl);
            System.out.println("ChatServer bound in registry");

        } catch (RemoteException ex){
            System.out.println(ex.getMessage());
        } catch (MalformedURLException ex){
            System.out.println(ex.getMessage());
        } catch (IOException ex){
            System.out.println(ex.getMessage());
        }
    }*/

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToggleButton1 = new javax.swing.JToggleButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtOutput = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jToggleButton1.setText("jToggleButton1");
        jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton1ActionPerformed(evt);
            }
        });

        txtOutput.setColumns(20);
        txtOutput.setRows(5);
        jScrollPane1.setViewportView(txtOutput);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(285, Short.MAX_VALUE)
                .addComponent(jToggleButton1)
                .addContainerGap())
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jToggleButton1)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
        // TODO add your handling code here:

    }//GEN-LAST:event_jToggleButton1ActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ServerImpl().setVisible(true);




            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JToggleButton jToggleButton1;
    private javax.swing.JTextArea txtOutput;
    // End of variables declaration//GEN-END:variables

}
